Repository navigation
diag(shell): stage 5 的 transport oracle 内部状态 (#80) - #220
Conversation
… refs #80 A diagnostic-only copy of the line rules records marker, output_seen, prompt_seen, malformed and the last partial line, so the unmet condition is observed instead of inferred.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8d9d7d6a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (kind == '[') { | ||
| while (i < raw.size() && ((raw[i] >= '0' && raw[i] <= '9') || raw[i] == ';' || raw[i] == '?')) ++i; | ||
| if (i == raw.size()) { malformed = true; break; } | ||
| ++i; | ||
| } else { malformed = true; break; } | ||
| } else if (byte == '\r') { |
There was a problem hiding this comment.
Match the actual oracle when reporting transport state
The probe disagrees with transport_output_completed() on the conditions it is intended to diagnose: TF_SIZE_80x24\r\nTF> completes the oracle but reports prompt_seen=false, and TF_SIZE_80x24 followed by a column-one CUP and TF> completes the oracle but reports both flags false. Conversely, the probe silently ignores bare CRs that the oracle rejects. Consequently, a timeout caused by another readiness condition can be incorrectly attributed to missing marker output or a missing prompt. Mirror the oracle's trailing-prompt, CUP-boundary, CSI-validation and CR rules, preferably through shared parsing logic so the diagnostic state cannot diverge.
Useful? React with 👍 / 👎.
| std::snprintf(buffer, sizeof(buffer), "\\x%02x", byte); | ||
| escaped += buffer; |
There was a problem hiding this comment.
Encode last_line using valid JSON escapes
If the unfinished output line contains a quote, backslash or non-ASCII byte, this emits \x22, \x5c or similar sequences directly into the JSON string. JSON does not support \xNN escapes, so ordinary command text or Windows paths make the new .jsonl record unparsable; a local probe with TF>echo "C:\tmp" reproduces the failure with json.loads. Use valid JSON escaping, or JSON-escape the diagnostic hex representation before writing it.
Useful? React with 👍 / 👎.
内容
为 #80 的 stage 5 超时增加 transport oracle 内部状态诊断(只读、仅失败路径):
local_shell_transport_probe()复刻 oracle 的行规则,扫描 WSL 的观测窗口;shells-transport-probe.jsonl:marker、output_seen、prompt_seen、malformed、last_line(转义、≤160 字符);这样下一次超时可以直接看出是"标记行没有成为完整行"(
output_seen=false)还是"没有提示符"(prompt_seen=false),不必再推断。为什么改在诊断文件里
上一轮尝试直接改
transport_completion.hpp失败(插入位置错误);本版把诊断放在local_shell_diagnostics.hpp,不触碰已验证的 oracle,避免任何判据行为变化。验证
termforge_shell构建通过。边界
sizes_ready()判据与期限;Refs #80